<?php
/////////////////////////////////////////////////////////////////////////////////////		
include "required_code.php"; 

	session_start();
	$ses_user_id =$_SESSION['ses_user_id'];
	$ses_std_id = $_SESSION['ses_std_id'];
	$concept=$_SESSION['concept'];
	if($ses_user_id <> session_id() or  $ses_std_id ==''){
		echo "Authentication failed";
		echo "<meta http-equiv='refresh' content='2;URL=index.php' />";
		}    
							$query2="SELECT * FROM std_vs_concept WHERE std_id=$ses_std_id AND concept=$concept ";
							$db_result2=db_query($query2);
							$result2=mysql_fetch_array($db_result2);
							//echo $result2['pretest_sts'];
							//if($result2['m1']==1){
							//	echo "Redirecting";
							//	echo "<meta http-equiv='refresh' content='1;URL=learning_paths.php' />";
							//}
							//else {	
											if($result2['m1']==0){
													$query_m1_record= "UPDATE std_vs_concept SET m1='1' WHERE std_id=$ses_std_id AND concept=$concept";
													$db_query_m1_record=db_query($query_m1_record);
											}
											if($result2['m1']==1){
													$query_m1_record= "UPDATE std_vs_concept SET m2='1' WHERE std_id=$ses_std_id AND concept=$concept";
													$db_query_m1_record=db_query($query_m1_record);
											}
											echo "Redirecting";
											echo "<meta http-equiv='refresh' content='1;URL=fa.php' />";
						$db_close=db_disconnect($db_open);
						//}
/////////////////////////////////////////////////////////////////////////////////////		
?>